"""
Choice
======
"""
from wxpita import *

genres = 'Country', 'Pop', 'Hip Hop', 'Rock', 'Jazz', 'Metal', 'Classical'

f = SizedFrame [
    ComboBox(name='cbox1', choices=genres),
    ComboBox(name='cbox2', expand=True),

    TextCtrl(name='log', style='te_multiline', expand=True, proportion=1),
]

@f.Init
def _():
    f.cbox1.SetSelection(4)
    
    for s in ['Cow', 'Chicken', 'Pig', 'Horse', 'Mule', 'Donkey', 'Ox']:
        f.cbox2.Append(s)

@f.cbox1.text_updated
@f.cbox2.text_updated
def _(evt):
    cbox = evt.EventObject
    mesg = "<%s>'s value changed to '%s'\n" % (cbox.GetName(), cbox.GetValue())
    f.log.AppendText(mesg)

f.Show('ComboBox Example', size=(370,300))
